<include file="Home/Public/Header" />
  <link href="__CSS__/common.css" rel="stylesheet" type="text/css">
  <link rel="stylesheet" type="text/css" href="__CSS__/global.css">
  <link href="__CSS__/global_new.css" rel="stylesheet" type="text/css">
  <link rel="stylesheet" type="text/css" href="__CSS__/Public.css">
  <link rel="stylesheet" type="text/css" href="__CSS__/Personal.css">
  <link rel="stylesheet" type="text/css" href="__CSS__/change.css">
  <link rel="stylesheet" type="text/css" href="__CSS__/sell.css">
  <link rel="stylesheet" type="text/css" href="__CSS__/upload.css">
  <style>
    .header {
      height:105px;
    }
    .gamedl {
      position: relative;
    }
    .gamedl img {
      position: absolute;
      top:-2px;
      right:6px
    }
    .error{color:red; padding-left:5px;}
  </style>
</head>
<body>
<!--头部开始-->

<include file="Home/Public/top_box" />
<include file="Home/Public/Search" />
<style>
  input{margin:0;padding:0;}
</style>
<div class="Navigation">
  <div class="center Part">
    <ul>
      <li> <a href="/Home/index.html" target="_self">首页</a> <a style="background:#1D62BF; color:#FFF;">个人中心</a> </li>
    </ul>
  </div>
</div>
<!--头部结束-->
<div class="clear"></div>
<div class="center yxlb"></div>
<div class="clear"></div>
<div class="center">
  <include file="Home/Member/LeftBar" />
  <!--右侧-->
  <div class="personal_right">
    <form id="releaseForm" method="post" action="{:U('Home/Salenew/salenew')}" enctype="multipart/form-data">
      <div class="cpxxlr">
        <h1><strong style="font-size:14px">商品信息</strong><span style="color:#FF0000;">* 请认真填写以下内容</span></h1>
        <ul>
          <li id="selectors">
            <span>已选商品分类：</span>
            <select id="first" class="yxn">
              <option value="0" selected="selected">游戏类型</option>
              <volist name="mark" id="vo">
                <option value="{$vo.gc_id}">{$vo.gc_name}</option>
              </volist>
            </select>
            <select id="second" class="yxn">
              <option value="0" selected>游戏名称</option>
            </select>
            <select id="third" class="yxn">
              <option value="0" selected>游戏区</option>
            </select>
            <select id="fourth" class="yxn" name="gc_id">
              <option  value="0" selected>游戏服务器</option>
            </select>
              <br /><br />
              <span>物品类型：</span>
            <select id="fifth" id="wplx" name="goods_typeid">
              <option value="0" selected>物品类型</option>
            </select>
          </li>

          <script type="text/javascript">
            (function(){
              var a = $('#first');
              var b = $('#second');
              var c = $('#third');
              var d = $('#fourth');
              var e = $('#fifth');

              var u1 = "{:U('Home/Api/GetCategoryOptionsHtml')}";
              var u2 = "{:U('Home/Api/GetTypeOptionsHtml')}";

              linkage(a, b, u1);
              linkage(b, c, u1);
              linkage(c, d, u1);
              linkage(d, e, u2);

              function linkage(a, b, u){
                a.change(function(){
                  b.html('<option>加载中...</option>');
                  changeIt(a, b, u);
                });
              }

              function changeIt(a, b, url){
                var _v = parseInt(a.val());
                if( _v > 0  ){
                  $.post(url, {v: _v}, function(data){
                    b.html(data);
                  });
                }else{
                  b.html('<option value="0">请选择</option>');
                }
              }
            })();
          </script>

          <li class="shuoming">当商品被订购后，担保客服会通知您上线，在游戏中接收宝贝后，替您交予买家验收。<br>
            商品上架后，您仍可在游戏中使用。 </li>
          <li><span>温馨提示：</span>为了顺利通过审核,请正确填写以下信息</li>
          <li><span><strong style="color:#F00">*</strong>商品标题：</span> <strong style="font-weight:bold;font-size:14px; float:left;" id="begin"></strong>
            <input type="text" id="titlesupplement" name="goods_title" class="xz" desc="商品标题" style="width:360px;" required>
            <!--<p class="qzqtx">商品标题请保持在50个字以内</p>-->
          </li>
          <li><span><strong style="color:#F00">*</strong>商品单价：</span>
            <input desc="商品价格" class="xz" type="text" id="price" commissionlist="0|9999999|2|4|50" name="goods_price" required>
            &nbsp;</li>
          <li><span><strong style="color:#F00">*</strong>发布件数：</span>
            <input desc="发布件数" class="xz" type="text" id="coun" name="goods_amount" required>
            &nbsp;</li>
          <li><span>商品总价：</span><span class="xz" id="countprice" style="text-align: left;"></span></li>
          <li><span><strong style="color:#F00">*</strong>商品描述：</span>
            <textarea cols="50" rows="4" class="xz" style="height:300px;float:left;width:580px;" id="description" name="goods_content" required></textarea>
          </li>
          <li><span>商品图片：</span>
            <div style="width: 590px;float: right;">
              <input type="file" name="cover[]" value="选择图片" style="width: 260px;">
              <input type="file" name="cover[]" value="选择图片" style="width: 260px;">
              <input type="file" name="cover[]" value="选择图片" style="width: 260px;">
              <input type="file" name="cover[]" value="选择图片" style="width: 260px;">
            </div>
          </li>


          <li>
            <div id="uploader-demo1">
              <!--用来存放item-->
              <!--<div id="equipPic" class="filePicker webuploader-container">-->
              <!--<div class="webuploader-pick">选择图片</div>-->
              <!--<div id="rt_rt_1afie15if8kn13c31s1r15oq13jq2" style="position: absolute; top: 0px; left: 0px; width: 66px; height: 24px; overflow: hidden; bottom: auto; right: auto;">-->
              <!--</div>-->
              <!--</div>-->
              <!--<div class="tips-num">(最多可上传5张图片)</div>-->
              <!--<div id="equipList" class="fileList uploader-list" style="height:150px"></div>-->
              <!--<input type="button" id="equipBtn" class="ctlBtn btn btn-default" value="开始上传">-->
            </div>
          </li>
          <li><span>&nbsp;</span>单张图片需小于<strong style="color:#F00">3M</strong>，不能带有人物角色名（带角色名图片将被删除)，支持jpg、png格式 [90px*90px]</li>
        </ul>
      </div>
      <div class="cpxxlr">
        <h1><strong style="font-size:14px">交易选项</strong></h1>
        <ul>
          <li> <span><strong style="color:#FF0000;">*</strong>交易通知方式：</span>
            <label style="float:left"> 手机通知&nbsp;&nbsp;</label>
            <input type="text" id="mobilenum" name="goods_mobile" value="{$member.member_mobile}" style="float:left" desc="手机号码" required>
          </li>
          <li style="padding-left:153px;">
            <label style="float:left"> QQ通知&nbsp;&nbsp;</label>
            <input type="text" name="goods_qq" value="{$member.member_qq}" style="float:left" placeholder="必填" desc="QQ号码">
          </li>
            <li style="padding-left:136px;">
                <label style="float:left"> 游乐淘账号&nbsp;&nbsp;</label>
                <input type="text" name="goods_tao" value="" style="float:left" desc="游乐淘账号" placeholder="必填" required>
            </li>
            <li style="padding-left:136px;">
                <label style="float:left"> 支付宝账号&nbsp;&nbsp;</label>
                <input type="text" name="goods_alipay" value="" style="float:left" desc="支付宝账号" placeholder="必填" required>
            </li>
        </ul>
      </div>
      <div style="text-align:center; text-align:center; margin-top:10px;">
        <input id="hlkOK" type="submit" class="sell_ok_tjfb" value="">
      </div>
    </form>
  </div>
</div>
<!-- footer -->
<include file="Home/Public/footer" />
<!-- footer -->
<script src="__SCRIPT__/jquery.form.min.js"></script>
<script>
  $(document).ready(function() {
    $("#price,#coun").change(function(){var p=$("#price").val();if(parseFloat(p).toFixed(2)<0.01){$("#price").val('')};var s=$("#coun").val();var total=p*s;$("#countprice").text(total.toFixed(2))});
    $.validator.addMethod("ylt",function(value,element){var v=$.trim(value);var l=v.length;if(l===0)return false;if(l<4||l>20)return false;var preg=/^[a-zA-Z_\d]{4,20}$/;if(!preg.exec(value))return false;preg=/^\d{11}$/;if(preg.exec(value))return false;return true},"请输入正确的游乐淘账号");
    $("#releaseForm").validate({
      rules: {
        gc_id: {
          required: true,
          min: 1
        },
        goods_typeid: {
          required: true,
          min: 1
        },
        goods_title: {
          required: true,
          rangelength: [1, 50]
        },
        goods_price: {
          required: true,
          min: 0.01,
          number: true
        },
        goods_amount: {
          required: true,
          min: 1,
          digits: true
        },
        goods_content: {
          required: true,
          minlength:1
        },
        goods_mobile: {
          required: true,
          rangelength: [11, 11],
          digits: true
        },
        goods_qq: {
          required: true,
          rangelength: [5, 11],
          digits: true
        },
        goods_tao: {
          required: true,
          ylt: true
        },
        goods_alipay: "required"
      },
      messages: {
        gc_id: {
          required: "请选择游戏服务器",
          min: "请选择游戏服务器"
        },
        goods_typeid: {
          required: "请选择物品类型",
          min: "请选择物品类型"
        },
        goods_title: {
          required: "请输入商品标题",
          rangelength: "商品标题长度必须介于 5 和 50 之间"
        },
        goods_price: {
          required: "请输入商品单价",
          min: "商品单价不能小于0.01",
          number: "商品单价必须输入合法的数字"
        },
        goods_amount: {
          required: "请输入发布件数",
          min: "发布件数不能小于1",
          digits: "发布件数必须输入整数"
        },
        goods_content: {
          required: "请输入商品描述",
          minlength:"商品描述不能少于1个字"
        },
        goods_mobile: {
          required: "请输入手机号码",
          rangelength: "请输入正确的手机号码",
          digits: "请输入正确的手机号码"
        },
        goods_qq: {
	      required: "请输入QQ号码",
          rangelength: "请输入正确的QQ号码",
          digits: "请输入正确的QQ号码"
        },
        goods_tao: {
          required: "请输入游乐淘帐号",
          ylt: "请确认您输入的账号是否正确"
        },
        goods_alipay: "请输入支付宝帐号"
      }
    })
  })

</script>
</body>
</html>